import getApiData from "@/services/cpasRequest";
// 获取账套
export async function getAccountInfo(params: {
    dbname: string;
}) {
    if (!params.dbname) return [];
    const res = await getApiData("account.accountInfo.getDataList", params);
    if (res.ok) {
        return Promise.resolve({
            data: res.data,
            success: true,
        });
    }
    return Promise.resolve({
        data: [],
        success: false,
    });
}

// 重新计算报表项目数据
export async function reCalReportItemsData(params: {
    dbname: string;
    Data_ID: string;
    editUser: any;
    isRecalTZ: boolean
}) {
    const res = await getApiData("account.reportItem.reCal", params);
    if (res.ok) {
        return Promise.resolve({
            data: res.data,
            success: true,
        });
    }
    return Promise.resolve({
        data: [],
        success: false,
    });
}